﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Category.aspx.cs" MasterPageFile="~/Admin/mspAdmin.Master" Inherits="BookOnline.Admin.Include.Category" %>
<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder2">
    <form runat=server>
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                
                &nbsp;Category Name:
                <asp:TextBox ID="txtCatName" runat="server"></asp:TextBox>
                &nbsp;&nbsp;<asp:TextBox ID="txtCatID" runat="server" Visible="False"></asp:TextBox>
                &nbsp; Category Parent:
                <asp:TextBox ID="txtCatParent" runat="server"></asp:TextBox>
                
                &nbsp;&nbsp;
                <asp:Button ID="btnSave" runat="server" Text="Add" onclick="btnSave_Click" />
                &nbsp;&nbsp;
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" Visible="False" 
                    onclick="btnCancel_Click" />
            
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            onrowcommand="GridView1_RowCommand" CssClass="grid-data">
            <Columns>
                <asp:BoundField DataField="CatID" HeaderText="Category ID" />
                <asp:BoundField DataField="CatName" HeaderText="Category Name" />
                <asp:BoundField DataField="CatParent" HeaderText="Category Parent" />
                <asp:TemplateField HeaderText="Edit">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtEdit" runat="server" 
                            CommandArgument='<%# Eval("CatID") %>' CommandName="sua" 
                            CssClass="btnedit">Edit</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtDelete" runat="server" 
                            CommandArgument='<%# Eval("CatID") %>' CommandName="xoa" CssClass="btndel" 
                            onclientclick="return confirm('Are you sure?')">Delete</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        
            </ContentTemplate>
           
        </asp:UpdatePanel>
    </div>
    </form>
</asp:Content>

